package com.yhsimon.principle._1_single_responsibility;


public class SingleResponsibility3 {
    public static void main(String[] args) {
        Vehicle2 vehicle2 = new Vehicle2();
        vehicle2.airRun("air");
        vehicle2.roadRun("road");
        vehicle2.waterRun("water");
    }
}

//1. 这种修改方法没有对原来的类做大的修改，只是增加方法
//2. 这里虽然没有在类这个级别上遵守单一职责原则，但是在方法级别上，仍然是遵守单一职责
class Vehicle2{
    public void roadRun(String vehicle){
        System.out.println(vehicle+"roadRun...");
    }
    public void waterRun(String vehicle){
        System.out.println(vehicle+"waterRun...");
    }
    public void airRun(String vehicle){
        System.out.println(vehicle+"airRun...");
    }


}

